package com.cosytek.farmmanager.data;

import org.json.JSONException;
import org.json.JSONObject;

/**
 * Created by Happy on 2015/4/19.
 */
public class TaskSummary {
    private String id;
    private String name;

    public TaskSummary(String id, String name) {
        this.id = id;
        this.name = name;
    }


    public String getId() {
        return id;
    }

    public String getName() {
        return name;
    }

    public static TaskSummary createFromJSONObject(JSONObject jsonObject) {
        String id = null;
        try {
            id = jsonObject.getString("id");
            String name = jsonObject.getString("name");
            TaskSummary ts = new TaskSummary(id, name);
            return ts;
        } catch (JSONException e) {
            e.printStackTrace();
        }
        return null;
    }
}
